Skip to content

fix(c-generative-ui): emit_state → get_stream_writer (LangGraph 1.x)#360

Merged
blove merged 1 commit into
mainfrom
claude/c-genui-fix-emit-state
May 16, 2026
Merged

fix(c-generative-ui): emit_state → get_stream_writer (LangGraph 1.x)#360
blove merged 1 commit into
mainfrom
claude/c-genui-fix-emit-state

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 16, 2026

Summary

  • Dashboard cards/charts/tables in the c-generative-ui demo never populated past the "Building UI…" skeleton — verified via chrome MCP that 7 placeholders remained and ~67 NG0303 input-spam errors fired per turn.
  • Root cause: adispatch_custom_event no longer flows into the custom stream channel in LangGraph 1.x. Live SSE inspection: 0 custom events with the old API, 1 custom event with get_stream_writer().
  • Payload also needed to match the chat-lib bridge contract — {name: "state_update", data: <flat-patches>} — so the bridge's eventData.name routing and eventData.data extraction hit the right slots, then signal-state-store.update() receives the flat {"/on_time/value": "84.2%", …} map it expects.

Test plan

  • Direct uv test of adispatch_custom_event in a minimal graph → 0 custom events emitted (confirms the regression)
  • Direct uv test of get_stream_writer() in a minimal graph → custom events emit correctly
  • Curl-driven SSE test against the umbrella backend with my fix → 1 event: custom with all 7 state paths in payload
  • Manual chrome MCP smoke (real LLM via repo-root .env): "Show me the dashboard" → 4 stat_cards populated, 1 line_chart with 12 monthly data points, 1 bar_chart with 4 airlines, 1 data_grid with 5 disruptions, zero render-default-fallback components, zero NG0303 errors

Files

  • cockpit/langgraph/streaming/python/src/dashboard_graph.py — switch emit_state to get_stream_writer(), wrap payload as {name, data}
  • cockpit/chat/generative-ui/python/src/graph.py — same fix in the standalone copy

🤖 Generated with Claude Code

…ph 1.x)

The dashboard's KPI cards / charts / tables never populated past the
"Building UI…" skeleton. Root cause: `adispatch_custom_event` no longer
flows into the `custom` stream channel in LangGraph 1.x. Live verification
via SSE shows 0 custom events with adispatch and 1 custom event with
get_stream_writer().

Additional fix: the payload now matches the chat-lib bridge's expected
shape — `{name: "state_update", data: <patches>}`. The bridge
(stream-manager.bridge.ts) reads `eventData.name` for routing and
`eventData.data` for the flat path→value patches that
signal-state-store.update() needs.

Verified end-to-end via chrome MCP — all 7 state paths now populate
correctly (4 stat_cards, 1 line_chart, 1 bar_chart, 1 data_grid) with
zero render-default-fallback components remaining and zero NG0303
input-spam errors.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 16, 2026 3:37pm

Request Review

@blove blove merged commit 5a917fc into main May 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant